package com.example.entry;

import java.io.File;

public class BodyVo {
    private  String name ;

    private  String type;

    private  Object value;

    private String fullPath;

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getType() {
        return type;
    }

    public void setType(String type) {
        this.type = type;
    }

    public Object getValue() {
        return value;
    }

    public void setValue(Object value) {
        this.value = value;
    }

    public String getFullPath() {
        return fullPath;
    }

    public void setFullPath(String fullPath) {
        this.fullPath = fullPath;
    }

    // 辅助方法
    public String getDisplayValue() {
        Object val = this.value;
        if (val == null) return "";
        if ("文件".equals(this.type)) {
            if (val instanceof File) {
                return ((File) val).getName();
            } else if (val instanceof String) {
                File file = new File(val.toString());
                return file.getName();
            }
        }
        return val.toString();
    }


}
